ReactiveOwningComponentBase class¶
Defined in
Namespace: ReactiveUI.Blazor
Assembly: ReactiveUI.Blazor.dll
Full name: ReactiveUI.Blazor.ReactiveOwningComponentBase<T>
Modifiers: public
Summary¶
A base component for handling property changes and updating the Blazor view appropriately.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1
Class hierarchy
classDiagram
class ReactiveOwningComponentBase~T~
class OwningComponentBase~T~
OwningComponentBase~T~ <|-- ReactiveOwningComponentBase~T~
class IViewFor~T~ {
<>
}
IViewFor~T~ <|.. ReactiveOwningComponentBase~T~
class IViewFor {
<>
}
IViewFor <|.. ReactiveOwningComponentBase~T~
class IActivatableView {
<>
}
IActivatableView <|.. ReactiveOwningComponentBase~T~
class INotifyPropertyChanged {
<>
}
INotifyPropertyChanged <|.. ReactiveOwningComponentBase~T~
class ICanActivate {
<>
}
ICanActivate <|.. ReactiveOwningComponentBase~T~
Inherits from: OwningComponentBase
Implements: IViewFor
Remarks¶
This component triggers StateHasChanged when either the view model instance changes or the current view model raises PropertyChanged.
Trimming/AOT: this type avoids expression-tree-based ReactiveUI helpers (e.g. WhenAnyValue) and uses event-based observables instead.
This type derives from OwningComponentBase so the DI scope and owned service lifetime are managed by the base class.
Constructors¶
| Name | Summary |
|---|---|
| .ctor |
Properties¶
| Name | Summary |
|---|---|
| ViewModel | Gets or sets the view model associated with this component. |
| Activated | Gets a observable which is triggered when the ViewModel is activated. |
| Deactivated | Gets a observable which is triggered when the ViewModel is deactivated. |
Methods¶
| Name | Summary |
|---|---|
| OnInitialized | Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. |
| OnAfterRender | Method invoked after each time the component has rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any... |
| OnPropertyChanged | Invokes the property changed event. |
| Dispose | Releases the service scope used by the component. |
Events¶
| Name | Summary |
|---|---|
| PropertyChanged |